library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(readxl)
library(png)
Arctic_Carn <- read_excel("~/Desktop/Data.xlsx")
head(Arctic_Carn)
## # A tibble: 6 × 13
## Code Family Species Sex Diet `Body mass (kg)` `Skull length (mm…
## <chr> <chr> <chr> <chr> <chr> <dbl> <dbl>
## 1 VLA Canidae Vulpes lagopus M V 5.75 140.
## 2 VLA Canidae Vulpes lagopus F V 5.75 119.
## 3 CLA Canidae Canis latrans M V/NV 13 178.
## 4 CLA Canidae Canis latrans F V/NV 13 178.
## 5 CLUa Canidae Canis lupus arc… M V 44.5 239.
## 6 CLUb Canidae Canis lupus bai… M V 38 236.
## # … with 6 more variables: Chamber volume (mm3) <dbl>, TTSA (mm2) <dbl>,
## # RTSA (mm2) <dbl>, OTSA (mm2) <dbl>, OTSA/RTSA <dbl>, Arctic/Temperate <chr>
Arctic_Carn_Clean <- Arctic_Carn %>% dplyr::select(Code, Family,Diet, "Body mass (kg)", "Skull length (mm)", "Chamber volume (mm3)", "TTSA (mm2)", "RTSA (mm2)", "OTSA (mm2)", "OTSA/RTSA" )
head(Arctic_Carn_Clean)
## # A tibble: 6 × 10
## Code Family Diet `Body mass (kg)` `Skull length (mm)` `Chamber volume (mm3…
## <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 VLA Canidae V 5.75 140. 23397.
## 2 VLA Canidae V 5.75 119. 19991.
## 3 CLA Canidae V/NV 13 178. 49723.
## 4 CLA Canidae V/NV 13 178. 46113
## 5 CLUa Canidae V 44.5 239. 164810
## 6 CLUb Canidae V 38 236. 102307
## # … with 4 more variables: TTSA (mm2) <dbl>, RTSA (mm2) <dbl>,
## # OTSA (mm2) <dbl>, OTSA/RTSA <dbl>
library(pander)
Arctic_Carn_Clean_log <- mutate(Arctic_Carn_Clean, lnBM=log10(Arctic_Carn_Clean$`Body mass (kg)`), lnSL=log10(Arctic_Carn_Clean$`Skull length (mm)`), lnCV=log10(Arctic_Carn_Clean$`Chamber volume (mm3)`), lnTTSA=log10(Arctic_Carn_Clean$`TTSA (mm2)`), lnRTSA=log10(Arctic_Carn_Clean$`RTSA (mm2)`), lnOTSA=log10(Arctic_Carn_Clean$`OTSA (mm2)`), lnOTSARTSA=log10(Arctic_Carn_Clean$`OTSA/RTSA`))
Arctic_Carn_Clean_log
## # A tibble: 38 × 17
## Code Family Diet `Body mass (kg)` `Skull length (mm)` `Chamber volume (mm…
## <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 VLA Canidae V 5.75 140. 23397.
## 2 VLA Canidae V 5.75 119. 19991.
## 3 CLA Canidae V/NV 13 178. 49723.
## 4 CLA Canidae V/NV 13 178. 46113
## 5 CLUa Canidae V 44.5 239. 164810
## 6 CLUb Canidae V 38 236. 102307
## 7 CLUb Canidae V 38 236 100633.
## 8 LPI Canidae V 19.8 194. 114255.
## 9 NPR Canidae NV 7 127. 15929.
## 10 NPR Canidae NV 7 124. 16439.
## # … with 28 more rows, and 11 more variables: TTSA (mm2) <dbl>,
## # RTSA (mm2) <dbl>, OTSA (mm2) <dbl>, OTSA/RTSA <dbl>, lnBM <dbl>,
## # lnSL <dbl>, lnCV <dbl>, lnTTSA <dbl>, lnRTSA <dbl>, lnOTSA <dbl>,
## # lnOTSARTSA <dbl>
Figure 2 from Green et al. (2012)
library(ggplot2)
ggplt1 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnSL, Arctic_Carn_Clean_log$lnTTSA)) + geom_point(aes(shape=Family)) +
scale_x_continuous(breaks=seq(1.6,2.6,by=.2)) + scale_y_continuous(breaks=seq(3.5,5.5,by=.5)) +
stat_smooth(method = "lm", se=FALSE,fullrange=TRUE, color="black", size=.3,
aes(shape=Family)) +
stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="red", size=.3) +
labs(x = "Log10 skull length (mm)", y = "Log10 total turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black") )
## Warning: Ignoring unknown aesthetics: shape
ggplt1 + theme(legend.position = "none") +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
## Warning: Use of `Arctic_Carn_Clean_log$lnSL` is discouraged. Use `lnSL` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnTTSA` is discouraged. Use `lnTTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnSL` is discouraged. Use `lnSL` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnTTSA` is discouraged. Use `lnTTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnSL` is discouraged. Use `lnSL` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnTTSA` is discouraged. Use `lnTTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnSL` is discouraged. Use `lnSL` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnTTSA` is discouraged. Use `lnTTSA`
## instead.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_point).
## Warning: Removed 1 rows containing missing values (geom_text).
library(ggplot2)
ggplt2 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnBM, Arctic_Carn_Clean_log$lnRTSA)) + geom_point(aes(shape=Family)) +
scale_x_continuous(breaks=seq(-0.5,2.5,by=.5)) + scale_y_continuous(breaks=seq(2.5,5.0,by=.5)) +
stat_smooth(method = "lm", se=FALSE,fullrange=TRUE, color="black", size=.3,
aes(shape=Family)) +
stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="red", size=.3) +
labs(x = "Log10 mass (kg)", y = "Log10 respiratory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black") )
## Warning: Ignoring unknown aesthetics: shape
ggplt2 + theme(legend.position = "none") +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## `geom_smooth()` using formula 'y ~ x'
library(ggplot2)
ggplt3 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnCV, Arctic_Carn_Clean_log$lnRTSA)) + geom_point(aes(shape=Family)) +
scale_x_continuous(breaks=seq(3.0,6.0,by=.5)) + scale_y_continuous(breaks=seq(2.5,5.0,by=.5)) +
stat_smooth(method = "lm", se=FALSE,fullrange=TRUE, color="black", size=.3,
aes(shape=Family)) +
stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="red", size=.3) +
labs(x = "Log10 mass (kg)", y = "Log10 olfactory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black") )
## Warning: Ignoring unknown aesthetics: shape
ggplt3 + theme(legend.position = "none") +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## `geom_smooth()` using formula 'y ~ x'
Figure 3 from Green et al. (2012)
library(ggplot2)
ggplt4 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnBM, Arctic_Carn_Clean_log$lnOTSA)) + geom_point(aes(shape=Family)) +
scale_x_continuous(breaks=seq(-0.5,2.5,by=.5)) + scale_y_continuous(breaks=seq(3.5,5.5,by=.5)) +
stat_smooth(method = "lm", se=FALSE,fullrange=TRUE, color="black", size=.3,
aes(shape=Family)) +
stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="red", linetype = "dashed", size=.3) +
labs(x = "Log10 mass (kg)", y = "Log10 olfactory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black") )
## Warning: Ignoring unknown aesthetics: shape
ggplt4 + theme(legend.position = "none") +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnBM` is discouraged. Use `lnBM` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## `geom_smooth()` using formula 'y ~ x'
library(ggplot2)
ggplt5 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnCV, (Arctic_Carn_Clean_log$lnOTSA))) + geom_point(aes(shape=Family)) +
scale_x_continuous(breaks=seq(3.0,6.0,by=.5)) + scale_y_continuous(breaks=seq(3.5,5.5,by=.5)) +
stat_smooth(method = "lm", se=FALSE,fullrange=TRUE, color="black", size=.3,
aes(shape=Family)) + stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="red", size=.3, linetype = "dashed") +
labs(x = "Log10 chamber volume (mm3)", y = "Log10 olfactory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black"))
## Warning: Ignoring unknown aesthetics: shape
ggplt5 + theme(legend.position = "none") +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## `geom_smooth()` using formula 'y ~ x'
Figure 4 from Green et al. (2012)
library(ggplot2)
ggplt6 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnCV, (Arctic_Carn_Clean_log$lnOTSA))) + geom_point(aes(color=Diet, shape=Diet)) +
scale_x_continuous(breaks=seq(3.0,6.0,by=.5)) + scale_y_continuous(breaks=seq(3.5,5.5,by=.5)) + stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="black", size=.3) +
labs(x = "Log10 chamber volume (mm3)", y = "Log10 olfactory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black")) +
scale_shape_discrete(labels = c("Non-vetebrate", "Vertebrate","Vertebrate/Non-vertebrate")) +
scale_colour_discrete(labels = c("Non-vetebrate", "Vertebrate","Vertebrate/Non-vertebrate")) +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black")) + theme(legend.position = c(0.25, 0.85))
ggplt6
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnCV` is discouraged. Use `lnCV` instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
ggplt7 <- ggplot(Arctic_Carn_Clean_log, aes(Arctic_Carn_Clean_log$lnRTSA, (Arctic_Carn_Clean_log$lnOTSA))) + geom_point(aes(color=Diet, shape=Diet)) +
scale_x_continuous(breaks=seq(2.5,5.0,by=.5)) + scale_y_continuous(breaks=seq(3.5,5.5,by=.5)) +
stat_smooth(method = "lm",
formula =y ~ x,se = FALSE, color="black", size=.3) +
labs(x = "Log10 chamber volume (mm3)", y = "Log10 olfactory turbinal surface area (mm2)") + geom_text(aes(label=Code), size=2, data=Arctic_Carn_Clean_log) + theme(
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black")) +
scale_shape_discrete(labels = c("Non-vetebrate", "Vertebrate","Vertebrate/Non-vertebrate")) +
scale_colour_discrete(labels = c("Non-vetebrate", "Vertebrate","Vertebrate/Non-vertebrate")) +
theme(legend.title = element_blank(),
legend.spacing.y = unit(0, "mm"),
panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1, axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black")) + theme(legend.position = c(0.25, 0.85))
ggplt7
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnRTSA` is discouraged. Use `lnRTSA`
## instead.
## Warning: Use of `Arctic_Carn_Clean_log$lnOTSA` is discouraged. Use `lnOTSA`
## instead.